import requests

login_data = {
    "method": "post",
    "url": "http://192.168.10.131:8888/api/private/v1/login",
    "data": {"username": "admin", "password": "123456"}
}

upload_data = {
    "method": "post",
    "url": "http://192.168.10.131:8888/api/private/v1/upload",
    "headers": None,
    "files": None
}

resp = requests.request(**login_data)
token = resp.json()["data"]["token"]

upload_data["headers"] = {"Authorization": token}
upload_data["files"] = {
    "file": ("1.jpg", open("../files/1.jpg", "rb"), ".jpg")
}

resp1 = requests.request(**upload_data)
print(resp1.json())